home *** CD-ROM | disk | FTP | other *** search
- /*
- ------------------------------------------------------------------------------
- This AREXX-Script will convert any 24Bit image to any number of colors,
- specified by the user in the argument.
- The user decides to scale or not.
-
- Host address: ADPro (Art Department Professional ®ASDG)
- Written by Jan Van Overbeke, 3-DEE, ©1993.
- Read the AREXX-Scripti doc, for info about operation and rights!
- ------------------------------------------------------------------------------
- */
-
- parse arg filename colors ditherc sx sy sc
- if ~exists(filename)|filename='' then do
- say 'File not found!'
- say 'See Ya.........'
- say ''
- exit
- end
-
- /* ---- Is the color argument right? ---- */
- /* -------------------------------------- */
- if ~(colors=256|colors='HAM8'|colors='HAM'|colors=2|colors=4|colors=8|colors=16|colors=32|colors=64|colors=128) then do
- say "Unknown colors: wrong argument"
- say 'See Ya.....'
- say ''
- exit
- end
-
- if ~(ditherc>-1|ditherc<7)then do
- say 'Invalid dither-number!'
- say 'See Ya.......'
- say ''
- exit
- end
-
- address 'ADPro'
- say 'Convert 24Bit To IFF: Written by Jan Van Overbeke, 3-DEE, ©1993.'
- say 'Image: 'filename
- say 'Colors: 'colors
- say 'Dithering Nmr: 'ditherc
- say 'Screen Code: 'sc
- say ''
-
- lformat 'UNIVERSAL'
- if RC~=0 then do
- say 'Unable to switch to Universal-loader'
- say 'See Ya.......'
- say ''
- exit
- end
-
- sformat 'IFF'
- if RC~=0 then do
- say 'Unable to switch to IFF-Saver'
- say 'See Ya.......'
- say ''
- exit
- end
-
- say 'Loading.......'
- load filename
- if RC~=0 then do
- say 'Load failed!!!!!!'
- say 'See Ya......'
- say ''
- exit
- end
-
- /* ---- Adjusting palette to requested # colors. ---- */
- /* -------------------------------------------------- */
- say 'Converting.....'
- render_type colors
- palette=0
- if colors='HAM8' then palette=64
- if colors='HAM' then palette=16
- if palette=0 then palette=colors
- ptotal palette
- pused palette
-
- dither ditherc
- if RC~=0 then do
- say 'Had trouble switching Dither!'
- say 'See Ya.....'
- say ''
- exit
- end
-
- screen_type sc
- if RC~=0 then do
- say 'Unable to change screen!!!!'
- say 'Wrong argument?'
- say 'See Ya......'
- say ''
- exit
- end
-
- ABS_SCALE sx sy
- if RC~=0 then do
- say 'Scale failed!!!!'
- say 'See Ya.....'
- say ''
- exit
- end
-
- execute
- if RC~=0 then do
- say 'Execute failed!!!!'
- say 'See Ya......'
- say ''
- exit
- end
-
- say 'Saving......'
- save filename'.new' IMAGE
- if RC~=0 then do
- say 'Save failed!!!!'
- say 'See Ya....'
- say ''
- exit
- end
-
- dither 0
- if RC~=0 then do
- say 'Unable to switch dither to 0!'
- say 'See Ya.....'
- end
- say ''
- exit
-